#include <stdio.h>
#include <stdlib.h>

int main (int argc, char const* argv[])
{
    int n, i, ccnt, cnt, s, p, a[128], ans;

    scanf("%d", &n);
    ccnt = 1;
    while(ccnt <= n) {
        scanf("%d %d %d", &cnt, &s, &p);
        ans = 0;
        for (i = 0; i < cnt; i++) {
            scanf("%d", &a[i]);
            if (a[i] / 3 >= p) {
                ans++;
            }
        }
        printf("Case #%d: %d\n", ccnt, ans);
        ccnt++;
    }

    return 0;
}
